// 引入全局ts
import type {PageResult,PageParams} from '@/types/global'
// 引入home.ts
import type { BannerItem, HotItem,CategoryItem,GuessItem} from '@/types/home'

import { http } from '@/utils/http'

// 首页-广告区域-小程序

export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

// 首页-前台分类-小程序
export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli'
  })
}
// 首页-前台热门推荐-小程序
export const getHomeHotAPI = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli'
  })
}
// 首页-前台猜你喜欢-小程序
export const getHomeGoodsGuessLikeAPI = (data?:PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data
  })
}